/*
 * JVMWrapper.h  0.4.0 / Nov 14, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef JVMWRAPPER_H
#define JVMWRAPPER_H

#include "Cute4jCommon.h"

// JVMWrapper Class. -----------------------------------------------------------

/*!
 * \brief JVM Wrapper.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT JVMWrapper
{
public:
  static void initialize(JavaVM *jvm);
  static JNIEnv *getEnv();
  static void exit(int status = -1);
  static void exitCritical(int status = -1);
  static bool attachCurrentThread();
  static bool detachCurrentThread();
private:
  void static exitJVM(JNIEnv *env, int status);
private:
  static JavaVM *sm_jvm;
};

#endif // JVMWRAPPER_H

